<?php

namespace app\api\validate;

use think\Validate;
class LetterOrder extends Validate
{
    protected $rule = [
        'user_id|用户' => 'require',
        'method|写信方法' => 'require',
        'file_urls|文件' => 'require',
        'image_url|手写信' => 'require',
        'card_front|明信片正面图片' => 'require',
        'reverse_content|明信片反面内容' => 'require',
        'postcode|明信片邮编' => 'require',
        'title|信件称呼' => 'require',
        'content|信件内容' => 'require',
        'sign|信件署名' => 'require',
        'temp_id|信件模板' => 'require',
        'ttf_id|字体' => 'require',
        'letter_content_id|信件内容' => 'require',
        'order_goods_list|商品' => '',
        'send_addr_id|送件地址' => 'require',
        'take_addr_id|寄件地址' => 'require',
        'delivery|寄信方式' => 'require',
        'is_replace|是否需要代收信件' => 'boolean',
    ];

    protected $message = [
    ];

    protected $scene = [
        'a4_pay' => [
            'letter_content_id',
            'send_addr_id',
            'take_addr_id',
            'delivery',
            'is_replace',
        ],
        'text_pay' => [
            'letter_content_id',
            'send_addr_id',
            'take_addr_id',
            'delivery',
            'is_replace',
        ],
        'hand_pay' => [
            'image_url',
            'send_addr_id',
            'take_addr_id',
            'delivery',
            'is_replace',
        ],
        'diy_pay' => [
            'card_front',
            'postcode',
            'reverse_content',
            'send_addr_id',
            'take_addr_id',
            'delivery',
            'is_replace',
        ],
        'file_pay' => [
            'file_urls',
            'send_addr_id',
            'take_addr_id',
            'delivery',
            'is_replace',
        ],
        //内容
        'content' => [
            'title',
            'content',
            'sign',
            'temp_id',
            'ttf_id'
        ],
    ];
}